#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    while (scanf("%d", &n) != EOF){
        queue<int> childen;
        for (int i = 1; i <= n; i++){
            childen.push(i);
        }
        while (n--&&childen.size() > 2){
            for (int i = 0; i < 1; i++){
                childen.push(childen.front());
                childen.pop();
            }
            cout << childen.front() << " ";
            childen.pop();
        }
        cout << endl;
        int a = childen.front(), b = childen.back();
        cout << min(a, b) << ' ' << max(a, b) << endl;
    }
    return 0;
}